package com.fuyun.rpc.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.ToString;

/**
 * @Author fuyun。
 * @Date 2025/8/21 15:57。
 * @Description: TODO。
 **/
@Getter
@ToString
@AllArgsConstructor

public enum RpcRespStatus {
    SUCCESS(1, "success"),
    FAILED(999, "failed"),
    ;
    private final int code;
    private final String msg;

    public static boolean isSuccessful(int code) {
        return SUCCESS.getCode() == code;
    }

    public static boolean isFailed(int code) {
        return !(isSuccessful(code));
    }

}
